//思路就是pow(a,n)不断进行分为子问题
class Solution 
{
public:
    double dfs(double x,long long n)
    {
        if(n==0) return 1; 
        double tem=dfs(x,n/2);
        return n%2==0?tem*tem:tem*tem*x;
    }
    double myPow(double x, int n) 
    {
        int flag=1;
        if(n<0)
        {
            
            return 1/dfs(x,(long long)n);
        }
        else
        {
            return dfs(x,n);
        }
    }
};